<template>
  <div>myError</div>
</template>
<script setup lang="ts">
import { onBeforeMount, onMounted, reactive, ref } from "vue";
const emits = defineEmits([]);
const props = defineProps({});
const state = reactive({});
onBeforeMount(() => {});
onMounted(() => {
  const route = useRoute();
  switch (route.query.code) {
    case "401":
      ElMessage.error("用户没有权限（令牌、用户名、密码错误）!");
      sessionStorage.clear();
      navigateTo("/login");
      break;

    default:
      ElMessage.error(route.query.code + ":" + route.query.message);
  }
});
defineExpose({ state });
</script>
<style lang="scss" scoped></style>
